<?php
$caption = BUtils::T('billing_lbl');
$this->pageTitle = $caption;

$this->breadcrumbs = array(
	$caption,
);
?>
<div class="page-header position-relative">
	<h1>
		<?php echo $caption; ?>
	</h1>
</div><!--/.page-header-->

<div class="row-fluid">
	<!-- Message -->
	<div class="alert alert-block alert-success">
		<button type="button" class="close" data-dismiss="alert">
			<i class="icon-remove"></i>
		</button>
		<i class="icon-info-sign green"></i>
		<?php echo BUtils::T('invocie_eg'); ?>
	</div>
	
	<div class="space-6"></div>
	
	<div class="row-fluid">
		<div class="span12">
			<div class="widget-box transparent">
				<div class="widget-header">
					<h3 class="lighter blue"><?php echo BUtils::T('invoice_lbl'); ?></h3>
				</div>
				<div class="widget-body">
					<div class="widget-body-inner">
					<div class="widget-main">
<div role="grid" class="dataTables_wrapper" id="table_report_wrapper">
	<table class="table table-striped table-bordered table-hover">
		<thead>
			<tr>
				<th><?php echo BUtils::T('invoice_lbl'); ?> #</th>
				<th><?php echo BUtils::T('invoice_date_lbl'); ?></th>
				<th><?php echo BUtils::T('invoice_due_date_lbl'); ?></th>
				<th><?php echo BUtils::T('invoice_total_lbl'); ?></th>
				<th><?php echo BUtils::T('invoice_status_lbl'); ?></th>
				<th></th>
			</tr>
		</thead>
		<tbody>
<?php
foreach ($rows as $r) {
	if (0 == $r['status']) $status = '<span class="label label-warning">'.BUtils::T('invoice_unpaid_lbl').'</span>';
	else $status = '<span class="label label-success">'.BUtils::T('invoice_paid_lbl').'</span>';
?>
			<tr>
				<td><?php echo $r['invoice_no']; ?></td>
				<td><?php echo $r['invoice_date']; ?></td>
				<td><?php echo $r['due_date']; ?></td>
				<td><?php echo Yii::app()->locale->numberFormatter->formatCurrency($r['total_price'], 'EUR'); ?></td>
				<td><?php echo $status; ?></td>
				<td><?php echo CHtml::link(BUtils::T('invoice_view_lbl'), Yii::app()->createUrl('/profile/invoiceDownload', array('id'=>$r['id'])), array('class'=>'btn btn-primary btn-small')); ?></td>
			</tr>
<?php } ?>
		</tbody>
	</table>
</div>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>